package com.zzptc.sky.myapplication;

import android.content.DialogInterface;
import android.content.Intent;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import java.io.BufferedReader;

public class MainActivity extends AppCompatActivity {
    Button dian=null;
Button aaa=null;
    Button bbb=null;
    Button ccc=null;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        aaa= (Button) findViewById(R.id.aa);
        bbb= (Button) findViewById(R.id.bb);
        ccc= (Button) findViewById(R.id.cc);
        dian= (Button) findViewById(R.id.dian);
        aaa.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent=new Intent(MainActivity.this,wuziqiActivity.class);
                startActivity(intent);
            }
        });
        bbb.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent=new Intent(MainActivity.this,RenjiActivity.class);
                startActivity(intent);
            }
        });
        ccc.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent=new Intent(MainActivity.this,ShezhiActivity.class);
                startActivity(intent);
            }
        });
        dian.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                AlertDialog alert = new AlertDialog.Builder(MainActivity.this).create();
                alert.setIcon(R.drawable.dianji);
                alert.setTitle("退出？");
                alert.setMessage("真的要退出本游戏吗？");
                alert.setButton(DialogInterface.BUTTON_NEGATIVE, "再战", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {

                    }
                });
                alert.setButton(DialogInterface.BUTTON_POSITIVE, "哥累了", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        finish();
                    }
                });
                alert.show();

            }
        });
    }

}
